package com.example.hibernate.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * Created by Yasin H on 2018/7/30.
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity(name = "address")
public class Address extends AbstractEntity {

    private String postcode;    //邮编
    private String street;  //街道

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private User user;

}
